5 REM 23 MATCHES MODIFIED BY ROBERT SIEG TO RUN ON A MC-10
6 REM USE MCX PLUS THE FSP APP
10 POKE49151,124:POKE1254,1:CLS
20 PRINT"Lets play 23 matches"
30 PRINT"You move first-Take 1,2, or 3 matches"
40 PRINT"The TRS-80 will take 1,2, or 3 matches"
50 PRINT"Take turns moving-The one who must take"
60 PRINT"the last match loses":INPUT"Push ENTER when ready ==> ";A$
70 CLS:M=23:FORD=3+1TO113+1STEP5:FORE=2+1TO8:SET(D,E,1):SET(D+1,E,1):NEXTE:NEXTD
80 B=1
90 FORE=2+1TO3+1:FORD=2+1TO112+1STEP5:SET(D,E,1):SET(D+3,E,1):NEXTD:NEXTE:D=3
100 PRINT@320,"Move","Matches Left","Your Move","TRS-80 Move"
110 PRINT@(B*64+320),B,M,:INPUTT
120 IFT>32767GOTO220
130 IF(T>M)+(T<>INT(T))+(T<1)+(T>3)GOTO220
140 M=M-T:G=T-1:GOSUB230:IFM=0GOTO200
150 IFM=1GOTO210
160 R=M-4*INT(M/4):IFR=1THENC=RND(3):GOTO180
170 C=(R+3)-4*INT((R+3)/4)
180 PRINT@(B*64+320),B,M+T,T,C:B=B+1
190 M=M-C:G=C-1:GOSUB230:GOTO110
200 PRINT"You Lose!!! Don't feel bad":GOTO250
210 PRINT"You Won!!!--You're better than most":GOTO250
220 PRINT@(B*64+340),"Invalid Move":FORX=1TO500:NEXTX:GOTO110
230 FORD=DTOG*5+DSTEP5:FORE=2TO8:FORZ=-1TO3:RESET(D+Z,E):NEXTZ
240 NEXTE:NEXTD:RETURN
250 PRINT@896,"";:INPUT"Do you want to play again (Y or N) ==> ";P$
260 IFP$="N"ORP$="n"THENEND
270 IFP$="Y"ORP$="y"THEN70
280 GOTO250
